import request from '@/utils/request'

// 查询订单分组信息列表
export function listTradeGroup(query) {
  return request({
    url: '/trade/group/list',
    method: 'get',
    params: query
  })
}

// 查询订单分组信息详细
export function getTradeGroup(groupId) {
  return request({
    url: '/trade/group/' + groupId,
    method: 'get'
  })
}

// 新增订单分组信息
export function addTradeGroup(data) {
  return request({
    url: '/trade/group',
    method: 'post',
    data: data
  })
}

// 修改订单分组信息
export function updateTradeGroup(data) {
  return request({
    url: '/trade/group',
    method: 'put',
    data: data
  })
}

// 删除订单分组信息
export function delTradeGroup(groupId) {
  return request({
    url: '/trade/group/' + groupId,
    method: 'delete'
  })
}

// 核销状态修改
export function changeTradeGroupStatus(groupId, status) {
  const data = {
    groupId,
    status
  }
  return request({
    url: '/trade/group/changeStatus',
    method: 'put',
    data: data
  })
}
